Integrand size = 19, antiderivative size = 221 \[ \int \frac {\cos (c+d x)}{(a+b \tan (c+d x))^3} \, dx=-\frac {3 b^2 \left (4 a^2-b^2\right ) \text {arctanh}\left (\frac {b-a \tan (c+d x)}{\sqrt {a^2+b^2} \sqrt {\sec ^2(c+d x)}}\right ) \cos (c+d x) \sqrt {\sec ^2(c+d x)}}{2 \left (a^2+b^2\right )^{7/2} d}+\frac {b \left (2 a^2-3 b^2\right ) \sec (c+d x)}{2 \left (a^2+b^2\right )^2 d (a+b \tan (c+d x))^2}+\frac {\cos (c+d x) (b+a \tan (c+d x))}{\left (a^2+b^2\right ) d (a+b \tan (c+d x))^2}+\frac {a b \left (2 a^2-13 b^2\right ) \sec (c+d x)}{2 \left (a^2+b^2\right )^3 d (a+b \tan (c+d x))} \]
-3/2*b^2*(4*a^2-b^2)*arctanh((b-a*tan(d*x+c))/(a^2+b^2)^(1/2)/(sec(d*x+c)^ 2)^(1/2))*cos(d*x+c)*(sec(d*x+c)^2)^(1/2)/(a^2+b^2)^(7/2)/d+1/2*b*(2*a^2-3 *b^2)*sec(d*x+c)/(a^2+b^2)^2/d/(a+b*tan(d*x+c))^2+cos(d*x+c)*(b+a*tan(d*x+ c))/(a^2+b^2)/d/(a+b*tan(d*x+c))^2+1/2*a*b*(2*a^2-13*b^2)*sec(d*x+c)/(a^2+ b^2)^3/d/(a+b*tan(d*x+c))
Time = 2.71 (sec) , antiderivative size = 183, normalized size of antiderivative = 0.83 \[ \int \frac {\cos (c+d x)}{(a+b \tan (c+d x))^3} \, dx=\frac {-\frac {12 b^2 \left (-4 a^2+b^2\right ) \text {arctanh}\left (\frac {-b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{7/2}}+\frac {\sec ^2(c+d x) \left (b \left (11 a^4-22 a^2 b^2-3 b^4\right ) \cos (c+d x)+b \left (a^2+b^2\right )^2 \cos (3 (c+d x))+2 a \left (a^4+4 a^2 b^2-12 b^4+\left (a^2+b^2\right )^2 \cos (2 (c+d x))\right ) \sin (c+d x)\right )}{\left (a^2+b^2\right )^3 (a+b \tan (c+d x))^2}}{4 d} \]
((-12*b^2*(-4*a^2 + b^2)*ArcTanh[(-b + a*Tan[(c + d*x)/2])/Sqrt[a^2 + b^2] ])/(a^2 + b^2)^(7/2) + (Sec[c + d*x]^2*(b*(11*a^4 - 22*a^2*b^2 - 3*b^4)*Co s[c + d*x] + b*(a^2 + b^2)^2*Cos[3*(c + d*x)] + 2*a*(a^4 + 4*a^2*b^2 - 12* b^4 + (a^2 + b^2)^2*Cos[2*(c + d*x)])*Sin[c + d*x]))/((a^2 + b^2)^3*(a + b *Tan[c + d*x])^2))/(4*d)
Time = 0.48 (sec) , antiderivative size = 250, normalized size of antiderivative = 1.13, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.526, Rules used = {3042, 3992, 496, 25, 27, 688, 25, 679, 488, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cos (c+d x)}{(a+b \tan (c+d x))^3} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\sec (c+d x) (a+b \tan (c+d x))^3}dx\) |
\(\Big \downarrow \) 3992 |
\(\displaystyle \frac {\sec (c+d x) \int \frac {1}{(a+b \tan (c+d x))^3 \left (\tan ^2(c+d x)+1\right )^{3/2}}d(b \tan (c+d x))}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 496 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {a b \tan (c+d x)+b^2}{\left (a^2+b^2\right ) \sqrt {\tan ^2(c+d x)+1} (a+b \tan (c+d x))^2}-\frac {b^2 \int -\frac {3 b^2+2 a \tan (c+d x) b}{b^2 (a+b \tan (c+d x))^3 \sqrt {\tan ^2(c+d x)+1}}d(b \tan (c+d x))}{a^2+b^2}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {b^2 \int \frac {3 b^2+2 a \tan (c+d x) b}{b^2 (a+b \tan (c+d x))^3 \sqrt {\tan ^2(c+d x)+1}}d(b \tan (c+d x))}{a^2+b^2}+\frac {a b \tan (c+d x)+b^2}{\left (a^2+b^2\right ) \sqrt {\tan ^2(c+d x)+1} (a+b \tan (c+d x))^2}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {\int \frac {3 b^2+2 a \tan (c+d x) b}{(a+b \tan (c+d x))^3 \sqrt {\tan ^2(c+d x)+1}}d(b \tan (c+d x))}{a^2+b^2}+\frac {a b \tan (c+d x)+b^2}{\left (a^2+b^2\right ) \sqrt {\tan ^2(c+d x)+1} (a+b \tan (c+d x))^2}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 688 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {\frac {\left (2 a^2-3 b^2\right ) \sqrt {\tan ^2(c+d x)+1}}{2 \left (\frac {a^2}{b^2}+1\right ) (a+b \tan (c+d x))^2}-\frac {b^2 \int -\frac {10 a-\left (3-\frac {2 a^2}{b^2}\right ) b \tan (c+d x)}{(a+b \tan (c+d x))^2 \sqrt {\tan ^2(c+d x)+1}}d(b \tan (c+d x))}{2 \left (a^2+b^2\right )}}{a^2+b^2}+\frac {a b \tan (c+d x)+b^2}{\left (a^2+b^2\right ) \sqrt {\tan ^2(c+d x)+1} (a+b \tan (c+d x))^2}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {\frac {b^2 \int \frac {10 a-\left (3-\frac {2 a^2}{b^2}\right ) b \tan (c+d x)}{(a+b \tan (c+d x))^2 \sqrt {\tan ^2(c+d x)+1}}d(b \tan (c+d x))}{2 \left (a^2+b^2\right )}+\frac {\left (2 a^2-3 b^2\right ) \sqrt {\tan ^2(c+d x)+1}}{2 \left (\frac {a^2}{b^2}+1\right ) (a+b \tan (c+d x))^2}}{a^2+b^2}+\frac {a b \tan (c+d x)+b^2}{\left (a^2+b^2\right ) \sqrt {\tan ^2(c+d x)+1} (a+b \tan (c+d x))^2}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 679 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {\frac {b^2 \left (\frac {3 \left (4 a^2-b^2\right ) \int \frac {1}{(a+b \tan (c+d x)) \sqrt {\tan ^2(c+d x)+1}}d(b \tan (c+d x))}{a^2+b^2}+\frac {a \left (2 a^2-13 b^2\right ) \sqrt {\tan ^2(c+d x)+1}}{\left (a^2+b^2\right ) (a+b \tan (c+d x))}\right )}{2 \left (a^2+b^2\right )}+\frac {\left (2 a^2-3 b^2\right ) \sqrt {\tan ^2(c+d x)+1}}{2 \left (\frac {a^2}{b^2}+1\right ) (a+b \tan (c+d x))^2}}{a^2+b^2}+\frac {a b \tan (c+d x)+b^2}{\left (a^2+b^2\right ) \sqrt {\tan ^2(c+d x)+1} (a+b \tan (c+d x))^2}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 488 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {\frac {b^2 \left (\frac {a \left (2 a^2-13 b^2\right ) \sqrt {\tan ^2(c+d x)+1}}{\left (a^2+b^2\right ) (a+b \tan (c+d x))}-\frac {3 \left (4 a^2-b^2\right ) \int \frac {1}{\frac {a^2}{b^2}-b^2 \tan ^2(c+d x)+1}d\frac {1-\frac {a \tan (c+d x)}{b}}{\sqrt {\tan ^2(c+d x)+1}}}{a^2+b^2}\right )}{2 \left (a^2+b^2\right )}+\frac {\left (2 a^2-3 b^2\right ) \sqrt {\tan ^2(c+d x)+1}}{2 \left (\frac {a^2}{b^2}+1\right ) (a+b \tan (c+d x))^2}}{a^2+b^2}+\frac {a b \tan (c+d x)+b^2}{\left (a^2+b^2\right ) \sqrt {\tan ^2(c+d x)+1} (a+b \tan (c+d x))^2}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {\frac {b^2 \left (\frac {a \left (2 a^2-13 b^2\right ) \sqrt {\tan ^2(c+d x)+1}}{\left (a^2+b^2\right ) (a+b \tan (c+d x))}-\frac {3 b \left (4 a^2-b^2\right ) \text {arctanh}\left (\frac {b^2 \tan (c+d x)}{\sqrt {a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2}}\right )}{2 \left (a^2+b^2\right )}+\frac {\left (2 a^2-3 b^2\right ) \sqrt {\tan ^2(c+d x)+1}}{2 \left (\frac {a^2}{b^2}+1\right ) (a+b \tan (c+d x))^2}}{a^2+b^2}+\frac {a b \tan (c+d x)+b^2}{\left (a^2+b^2\right ) \sqrt {\tan ^2(c+d x)+1} (a+b \tan (c+d x))^2}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
(Sec[c + d*x]*((b^2 + a*b*Tan[c + d*x])/((a^2 + b^2)*(a + b*Tan[c + d*x])^ 2*Sqrt[1 + Tan[c + d*x]^2]) + (((2*a^2 - 3*b^2)*Sqrt[1 + Tan[c + d*x]^2])/ (2*(1 + a^2/b^2)*(a + b*Tan[c + d*x])^2) + (b^2*((-3*b*(4*a^2 - b^2)*ArcTa nh[(b^2*Tan[c + d*x])/Sqrt[a^2 + b^2]])/(a^2 + b^2)^(3/2) + (a*(2*a^2 - 13 *b^2)*Sqrt[1 + Tan[c + d*x]^2])/((a^2 + b^2)*(a + b*Tan[c + d*x]))))/(2*(a ^2 + b^2)))/(a^2 + b^2)))/(b*d*Sqrt[Sec[c + d*x]^2])
3.6.76.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[1/(((c_) + (d_.)*(x_))*Sqrt[(a_) + (b_.)*(x_)^2]), x_Symbol] :> -Subst[ Int[1/(b*c^2 + a*d^2 - x^2), x], x, (a*d - b*c*x)/Sqrt[a + b*x^2]] /; FreeQ [{a, b, c, d}, x]
Int[((c_) + (d_.)*(x_))^(n_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[ (-(a*d + b*c*x))*(c + d*x)^(n + 1)*((a + b*x^2)^(p + 1)/(2*a*(p + 1)*(b*c^2 + a*d^2))), x] + Simp[1/(2*a*(p + 1)*(b*c^2 + a*d^2)) Int[(c + d*x)^n*(a + b*x^2)^(p + 1)*Simp[b*c^2*(2*p + 3) + a*d^2*(n + 2*p + 3) + b*c*d*(n + 2 *p + 4)*x, x], x], x] /; FreeQ[{a, b, c, d, n}, x] && LtQ[p, -1] && IntQuad raticQ[a, 0, b, c, d, n, p, x]
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p _.), x_Symbol] :> Simp[(-(e*f - d*g))*(d + e*x)^(m + 1)*((a + c*x^2)^(p + 1 )/(2*(p + 1)*(c*d^2 + a*e^2))), x] + Simp[(c*d*f + a*e*g)/(c*d^2 + a*e^2) Int[(d + e*x)^(m + 1)*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, m, p}, x] && EqQ[Simplify[m + 2*p + 3], 0]
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p _.), x_Symbol] :> Simp[(e*f - d*g)*(d + e*x)^(m + 1)*((a + c*x^2)^(p + 1)/( (m + 1)*(c*d^2 + a*e^2))), x] + Simp[1/((m + 1)*(c*d^2 + a*e^2)) Int[(d + e*x)^(m + 1)*(a + c*x^2)^p*Simp[(c*d*f + a*e*g)*(m + 1) - c*(e*f - d*g)*(m + 2*p + 3)*x, x], x], x] /; FreeQ[{a, c, d, e, f, g, p}, x] && LtQ[m, -1] && (IntegerQ[m] || IntegerQ[p] || IntegersQ[2*m, 2*p])
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n _), x_Symbol] :> Simp[Sec[e + f*x]/(b*f*Sqrt[Sec[e + f*x]^2]) Subst[Int[( a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b , e, f, n}, x] && NeQ[a^2 + b^2, 0] && IntegerQ[(m - 1)/2]
Time = 4.99 (sec) , antiderivative size = 283, normalized size of antiderivative = 1.28
method | result | size |
derivativedivides | \(\frac {-\frac {2 \left (\left (-a^{3}+3 a \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-3 a^{2} b +b^{3}\right )}{\left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {2 b^{2} \left (\frac {-\frac {b^{2} \left (9 a^{2}+2 b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {b \left (8 a^{4}-15 a^{2} b^{2}-2 b^{4}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a^{2}}+\frac {b^{2} \left (23 a^{2}+2 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a}+4 a^{2} b +\frac {b^{3}}{2}}{{\left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}^{2}}-\frac {3 \left (4 a^{2}-b^{2}\right ) \operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (a^{2}+b^{2}\right )^{3}}}{d}\) | \(283\) |
default | \(\frac {-\frac {2 \left (\left (-a^{3}+3 a \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-3 a^{2} b +b^{3}\right )}{\left (a^{6}+3 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {2 b^{2} \left (\frac {-\frac {b^{2} \left (9 a^{2}+2 b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}-\frac {b \left (8 a^{4}-15 a^{2} b^{2}-2 b^{4}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a^{2}}+\frac {b^{2} \left (23 a^{2}+2 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a}+4 a^{2} b +\frac {b^{3}}{2}}{{\left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a \right )}^{2}}-\frac {3 \left (4 a^{2}-b^{2}\right ) \operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{2 \sqrt {a^{2}+b^{2}}}\right )}{\left (a^{2}+b^{2}\right )^{3}}}{d}\) | \(283\) |
risch | \(-\frac {i {\mathrm e}^{i \left (d x +c \right )}}{2 \left (-3 i b \,a^{2}+i b^{3}+a^{3}-3 a \,b^{2}\right ) d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )}}{2 \left (3 i b \,a^{2}-i b^{3}+a^{3}-3 a \,b^{2}\right ) d}+\frac {b^{3} {\mathrm e}^{i \left (d x +c \right )} \left (-7 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}+8 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+7 i a b +8 a^{2}+b^{2}\right )}{\left (-i a +b \right )^{3} \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+i a \,{\mathrm e}^{2 i \left (d x +c \right )}-b +i a \right )^{2} d \left (i a +b \right )^{3}}+\frac {6 b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{7}+3 i a^{5} b^{2}+3 i a^{3} b^{4}+i a \,b^{6}-a^{6} b -3 a^{4} b^{3}-3 b^{5} a^{2}-b^{7}}{\left (a^{2}+b^{2}\right )^{\frac {7}{2}}}\right ) a^{2}}{\left (a^{2}+b^{2}\right )^{\frac {7}{2}} d}-\frac {3 b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{7}+3 i a^{5} b^{2}+3 i a^{3} b^{4}+i a \,b^{6}-a^{6} b -3 a^{4} b^{3}-3 b^{5} a^{2}-b^{7}}{\left (a^{2}+b^{2}\right )^{\frac {7}{2}}}\right )}{2 \left (a^{2}+b^{2}\right )^{\frac {7}{2}} d}-\frac {6 b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{7}+3 i a^{5} b^{2}+3 i a^{3} b^{4}+i a \,b^{6}-a^{6} b -3 a^{4} b^{3}-3 b^{5} a^{2}-b^{7}}{\left (a^{2}+b^{2}\right )^{\frac {7}{2}}}\right ) a^{2}}{\left (a^{2}+b^{2}\right )^{\frac {7}{2}} d}+\frac {3 b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{7}+3 i a^{5} b^{2}+3 i a^{3} b^{4}+i a \,b^{6}-a^{6} b -3 a^{4} b^{3}-3 b^{5} a^{2}-b^{7}}{\left (a^{2}+b^{2}\right )^{\frac {7}{2}}}\right )}{2 \left (a^{2}+b^{2}\right )^{\frac {7}{2}} d}\) | \(611\) |
1/d*(-2/(a^6+3*a^4*b^2+3*a^2*b^4+b^6)*((-a^3+3*a*b^2)*tan(1/2*d*x+1/2*c)-3 *a^2*b+b^3)/(1+tan(1/2*d*x+1/2*c)^2)-2*b^2/(a^2+b^2)^3*((-1/2*b^2*(9*a^2+2 *b^2)/a*tan(1/2*d*x+1/2*c)^3-1/2*b*(8*a^4-15*a^2*b^2-2*b^4)/a^2*tan(1/2*d* x+1/2*c)^2+1/2*b^2*(23*a^2+2*b^2)/a*tan(1/2*d*x+1/2*c)+4*a^2*b+1/2*b^3)/(t an(1/2*d*x+1/2*c)^2*a-2*b*tan(1/2*d*x+1/2*c)-a)^2-3/2*(4*a^2-b^2)/(a^2+b^2 )^(1/2)*arctanh(1/2*(2*a*tan(1/2*d*x+1/2*c)-2*b)/(a^2+b^2)^(1/2))))
Leaf count of result is larger than twice the leaf count of optimal. 480 vs. \(2 (209) = 418\).
Time = 0.31 (sec) , antiderivative size = 480, normalized size of antiderivative = 2.17 \[ \int \frac {\cos (c+d x)}{(a+b \tan (c+d x))^3} \, dx=\frac {4 \, {\left (a^{6} b + 3 \, a^{4} b^{3} + 3 \, a^{2} b^{5} + b^{7}\right )} \cos \left (d x + c\right )^{3} - 3 \, {\left (4 \, a^{2} b^{4} - b^{6} + {\left (4 \, a^{4} b^{2} - 5 \, a^{2} b^{4} + b^{6}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (4 \, a^{3} b^{3} - a b^{5}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )\right )} \sqrt {a^{2} + b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right ) + 2 \, {\left (4 \, a^{6} b - 10 \, a^{4} b^{3} - 17 \, a^{2} b^{5} - 3 \, b^{7}\right )} \cos \left (d x + c\right ) + 2 \, {\left (2 \, a^{5} b^{2} - 11 \, a^{3} b^{4} - 13 \, a b^{6} + 2 \, {\left (a^{7} + 3 \, a^{5} b^{2} + 3 \, a^{3} b^{4} + a b^{6}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{4 \, {\left ({\left (a^{10} + 3 \, a^{8} b^{2} + 2 \, a^{6} b^{4} - 2 \, a^{4} b^{6} - 3 \, a^{2} b^{8} - b^{10}\right )} d \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{9} b + 4 \, a^{7} b^{3} + 6 \, a^{5} b^{5} + 4 \, a^{3} b^{7} + a b^{9}\right )} d \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{8} b^{2} + 4 \, a^{6} b^{4} + 6 \, a^{4} b^{6} + 4 \, a^{2} b^{8} + b^{10}\right )} d\right )}} \]
1/4*(4*(a^6*b + 3*a^4*b^3 + 3*a^2*b^5 + b^7)*cos(d*x + c)^3 - 3*(4*a^2*b^4 - b^6 + (4*a^4*b^2 - 5*a^2*b^4 + b^6)*cos(d*x + c)^2 + 2*(4*a^3*b^3 - a*b ^5)*cos(d*x + c)*sin(d*x + c))*sqrt(a^2 + b^2)*log((2*a*b*cos(d*x + c)*sin (d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 - 2*a^2 - b^2 - 2*sqrt(a^2 + b^2)*( b*cos(d*x + c) - a*sin(d*x + c)))/(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2)) + 2*(4*a^6*b - 10*a^4*b^3 - 17*a^2*b^5 - 3*b ^7)*cos(d*x + c) + 2*(2*a^5*b^2 - 11*a^3*b^4 - 13*a*b^6 + 2*(a^7 + 3*a^5*b ^2 + 3*a^3*b^4 + a*b^6)*cos(d*x + c)^2)*sin(d*x + c))/((a^10 + 3*a^8*b^2 + 2*a^6*b^4 - 2*a^4*b^6 - 3*a^2*b^8 - b^10)*d*cos(d*x + c)^2 + 2*(a^9*b + 4 *a^7*b^3 + 6*a^5*b^5 + 4*a^3*b^7 + a*b^9)*d*cos(d*x + c)*sin(d*x + c) + (a ^8*b^2 + 4*a^6*b^4 + 6*a^4*b^6 + 4*a^2*b^8 + b^10)*d)
\[ \int \frac {\cos (c+d x)}{(a+b \tan (c+d x))^3} \, dx=\int \frac {\cos {\left (c + d x \right )}}{\left (a + b \tan {\left (c + d x \right )}\right )^{3}}\, dx \]
Leaf count of result is larger than twice the leaf count of optimal. 658 vs. \(2 (209) = 418\).
Time = 0.32 (sec) , antiderivative size = 658, normalized size of antiderivative = 2.98 \[ \int \frac {\cos (c+d x)}{(a+b \tan (c+d x))^3} \, dx=-\frac {\frac {3 \, {\left (4 \, a^{2} b^{2} - b^{4}\right )} \log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{{\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \sqrt {a^{2} + b^{2}}} - \frac {2 \, {\left (6 \, a^{6} b - 10 \, a^{4} b^{3} - a^{2} b^{5} + \frac {{\left (2 \, a^{7} + 18 \, a^{5} b^{2} - 31 \, a^{3} b^{4} - 2 \, a b^{6}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {2 \, {\left (2 \, a^{6} b - 2 \, a^{4} b^{3} + 12 \, a^{2} b^{5} + b^{7}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {2 \, {\left (2 \, a^{7} + 2 \, a^{5} b^{2} + 15 \, a^{3} b^{4}\right )} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {{\left (2 \, a^{6} b - 30 \, a^{4} b^{3} + 15 \, a^{2} b^{5} + 2 \, b^{7}\right )} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {{\left (2 \, a^{7} - 6 \, a^{5} b^{2} + 9 \, a^{3} b^{4} + 2 \, a b^{6}\right )} \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}\right )}}{a^{10} + 3 \, a^{8} b^{2} + 3 \, a^{6} b^{4} + a^{4} b^{6} + \frac {4 \, {\left (a^{9} b + 3 \, a^{7} b^{3} + 3 \, a^{5} b^{5} + a^{3} b^{7}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {{\left (a^{10} - a^{8} b^{2} - 9 \, a^{6} b^{4} - 11 \, a^{4} b^{6} - 4 \, a^{2} b^{8}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {{\left (a^{10} - a^{8} b^{2} - 9 \, a^{6} b^{4} - 11 \, a^{4} b^{6} - 4 \, a^{2} b^{8}\right )} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {4 \, {\left (a^{9} b + 3 \, a^{7} b^{3} + 3 \, a^{5} b^{5} + a^{3} b^{7}\right )} \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {{\left (a^{10} + 3 \, a^{8} b^{2} + 3 \, a^{6} b^{4} + a^{4} b^{6}\right )} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}}}{2 \, d} \]
-1/2*(3*(4*a^2*b^2 - b^4)*log((b - a*sin(d*x + c)/(cos(d*x + c) + 1) + sqr t(a^2 + b^2))/(b - a*sin(d*x + c)/(cos(d*x + c) + 1) - sqrt(a^2 + b^2)))/( (a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6)*sqrt(a^2 + b^2)) - 2*(6*a^6*b - 10*a^4 *b^3 - a^2*b^5 + (2*a^7 + 18*a^5*b^2 - 31*a^3*b^4 - 2*a*b^6)*sin(d*x + c)/ (cos(d*x + c) + 1) - 2*(2*a^6*b - 2*a^4*b^3 + 12*a^2*b^5 + b^7)*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - 2*(2*a^7 + 2*a^5*b^2 + 15*a^3*b^4)*sin(d*x + c )^3/(cos(d*x + c) + 1)^3 - (2*a^6*b - 30*a^4*b^3 + 15*a^2*b^5 + 2*b^7)*sin (d*x + c)^4/(cos(d*x + c) + 1)^4 + (2*a^7 - 6*a^5*b^2 + 9*a^3*b^4 + 2*a*b^ 6)*sin(d*x + c)^5/(cos(d*x + c) + 1)^5)/(a^10 + 3*a^8*b^2 + 3*a^6*b^4 + a^ 4*b^6 + 4*(a^9*b + 3*a^7*b^3 + 3*a^5*b^5 + a^3*b^7)*sin(d*x + c)/(cos(d*x + c) + 1) - (a^10 - a^8*b^2 - 9*a^6*b^4 - 11*a^4*b^6 - 4*a^2*b^8)*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - (a^10 - a^8*b^2 - 9*a^6*b^4 - 11*a^4*b^6 - 4 *a^2*b^8)*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 - 4*(a^9*b + 3*a^7*b^3 + 3*a ^5*b^5 + a^3*b^7)*sin(d*x + c)^5/(cos(d*x + c) + 1)^5 + (a^10 + 3*a^8*b^2 + 3*a^6*b^4 + a^4*b^6)*sin(d*x + c)^6/(cos(d*x + c) + 1)^6))/d
Time = 0.63 (sec) , antiderivative size = 399, normalized size of antiderivative = 1.81 \[ \int \frac {\cos (c+d x)}{(a+b \tan (c+d x))^3} \, dx=-\frac {\frac {3 \, {\left (4 \, a^{2} b^{2} - b^{4}\right )} \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{{\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \sqrt {a^{2} + b^{2}}} - \frac {4 \, {\left (a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a^{2} b - b^{3}\right )}}{{\left (a^{6} + 3 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}} - \frac {2 \, {\left (9 \, a^{3} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, a b^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 8 \, a^{4} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 15 \, a^{2} b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, b^{7} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 23 \, a^{3} b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, a b^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 8 \, a^{4} b^{3} - a^{2} b^{5}\right )}}{{\left (a^{8} + 3 \, a^{6} b^{2} + 3 \, a^{4} b^{4} + a^{2} b^{6}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a\right )}^{2}}}{2 \, d} \]
-1/2*(3*(4*a^2*b^2 - b^4)*log(abs(2*a*tan(1/2*d*x + 1/2*c) - 2*b - 2*sqrt( a^2 + b^2))/abs(2*a*tan(1/2*d*x + 1/2*c) - 2*b + 2*sqrt(a^2 + b^2)))/((a^6 + 3*a^4*b^2 + 3*a^2*b^4 + b^6)*sqrt(a^2 + b^2)) - 4*(a^3*tan(1/2*d*x + 1/ 2*c) - 3*a*b^2*tan(1/2*d*x + 1/2*c) + 3*a^2*b - b^3)/((a^6 + 3*a^4*b^2 + 3 *a^2*b^4 + b^6)*(tan(1/2*d*x + 1/2*c)^2 + 1)) - 2*(9*a^3*b^4*tan(1/2*d*x + 1/2*c)^3 + 2*a*b^6*tan(1/2*d*x + 1/2*c)^3 + 8*a^4*b^3*tan(1/2*d*x + 1/2*c )^2 - 15*a^2*b^5*tan(1/2*d*x + 1/2*c)^2 - 2*b^7*tan(1/2*d*x + 1/2*c)^2 - 2 3*a^3*b^4*tan(1/2*d*x + 1/2*c) - 2*a*b^6*tan(1/2*d*x + 1/2*c) - 8*a^4*b^3 - a^2*b^5)/((a^8 + 3*a^6*b^2 + 3*a^4*b^4 + a^2*b^6)*(a*tan(1/2*d*x + 1/2*c )^2 - 2*b*tan(1/2*d*x + 1/2*c) - a)^2))/d
Time = 8.10 (sec) , antiderivative size = 610, normalized size of antiderivative = 2.76 \[ \int \frac {\cos (c+d x)}{(a+b \tan (c+d x))^3} \, dx=-\frac {\frac {-6\,a^4\,b+10\,a^2\,b^3+b^5}{a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (2\,a^5+2\,a^3\,b^2+15\,a\,b^4\right )}{a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (2\,a^6\,b-30\,a^4\,b^3+15\,a^2\,b^5+2\,b^7\right )}{a^2\,\left (a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6\right )}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^6+18\,a^4\,b^2-31\,a^2\,b^4-2\,b^6\right )}{a\,\left (a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6\right )}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (2\,a^6-6\,a^4\,b^2+9\,a^2\,b^4+2\,b^6\right )}{a\,\left (a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6\right )}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^6\,b-2\,a^4\,b^3+12\,a^2\,b^5+b^7\right )}{a^2\,\left (a^6+3\,a^4\,b^2+3\,a^2\,b^4+b^6\right )}}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+a^2-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (a^2-4\,b^2\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (a^2-4\,b^2\right )-4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}-\frac {\mathrm {atan}\left (\frac {-1{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^7+a^6\,b\,1{}\mathrm {i}-3{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^5\,b^2+a^4\,b^3\,3{}\mathrm {i}-3{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3\,b^4+a^2\,b^5\,3{}\mathrm {i}-1{}\mathrm {i}\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^6+b^7\,1{}\mathrm {i}}{{\left (a^2+b^2\right )}^{7/2}}\right )\,\left (3\,b^4-12\,a^2\,b^2\right )\,1{}\mathrm {i}}{d\,{\left (a^2+b^2\right )}^{7/2}} \]
- ((b^5 - 6*a^4*b + 10*a^2*b^3)/(a^6 + b^6 + 3*a^2*b^4 + 3*a^4*b^2) + (2*t an(c/2 + (d*x)/2)^3*(15*a*b^4 + 2*a^5 + 2*a^3*b^2))/(a^6 + b^6 + 3*a^2*b^4 + 3*a^4*b^2) + (tan(c/2 + (d*x)/2)^4*(2*a^6*b + 2*b^7 + 15*a^2*b^5 - 30*a ^4*b^3))/(a^2*(a^6 + b^6 + 3*a^2*b^4 + 3*a^4*b^2)) - (tan(c/2 + (d*x)/2)*( 2*a^6 - 2*b^6 - 31*a^2*b^4 + 18*a^4*b^2))/(a*(a^6 + b^6 + 3*a^2*b^4 + 3*a^ 4*b^2)) - (tan(c/2 + (d*x)/2)^5*(2*a^6 + 2*b^6 + 9*a^2*b^4 - 6*a^4*b^2))/( a*(a^6 + b^6 + 3*a^2*b^4 + 3*a^4*b^2)) + (2*tan(c/2 + (d*x)/2)^2*(2*a^6*b + b^7 + 12*a^2*b^5 - 2*a^4*b^3))/(a^2*(a^6 + b^6 + 3*a^2*b^4 + 3*a^4*b^2)) )/(d*(a^2*tan(c/2 + (d*x)/2)^6 + a^2 - tan(c/2 + (d*x)/2)^2*(a^2 - 4*b^2) - tan(c/2 + (d*x)/2)^4*(a^2 - 4*b^2) - 4*a*b*tan(c/2 + (d*x)/2)^5 + 4*a*b* tan(c/2 + (d*x)/2))) - (atan((a^6*b*1i + b^7*1i + a^2*b^5*3i + a^4*b^3*3i - a^7*tan(c/2 + (d*x)/2)*1i - a*b^6*tan(c/2 + (d*x)/2)*1i - a^3*b^4*tan(c/ 2 + (d*x)/2)*3i - a^5*b^2*tan(c/2 + (d*x)/2)*3i)/(a^2 + b^2)^(7/2))*(3*b^4 - 12*a^2*b^2)*1i)/(d*(a^2 + b^2)^(7/2))